import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../views/Login.vue";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/home",
    name: "Home",
    component: Home,
    children: [
      {
        path: "/home/index",
        name: "Index",
        component: () => import("../components/index.vue"),
      },
      {
        path: "/home/house/unit",
        name: "Unit",
        component: () => import("../components/house/unit.vue"),
      },
      {
        path: "/home/house/add",
        name: "Add",
        component: () => import("../components/house/add.vue"),
        props: true,
      },
      {
        path: "/home/house/number",
        name: "Number",
        component: () => import("../components/house/number.vue"),
      },
      {
        path: "/home/house/numAdd",
        name: "NumAdd",
        component: () => import("../components/house/numAdd.vue"),
      },
      {
        path: "/home/house/dericelnfo",
        name: "Dericelnfo",
        component: () => import("../components/house/dericelnfo.vue"),
      },
      {
        path: "/home/parking/parkMessage",
        name: "ParkMessage",
        component: () => import("../components/parking/parkMessage.vue"),
      },
      {
        path: "/home/parking/parkPay",
        name: "ParkPay",
        component: () => import("../components/parking/parkPay.vue"),
      },
      {
        path: "/home/pay/payType",
        name: "paytype",
        component: () => import("../components/pay/payType.vue"),
      },
      {
        path: "/home/pay/payAdd",
        name: "payAdd",
        component: () => import("../components/pay/payAdd.vue"),
        props: true,
      },
      {
        path: "/home/pay/payMessage",
        name: "PayMessage",
        component: () => import("../components/pay/payMessage.vue"),
      },
      {
        path: "/home/pay/payDetail",
        name: "PayDetail",
        component: () => import("../components/pay/payDetail.vue"),
        props: true,
      },
      {
        path: "/home/service/postMessage",
        name: "PostMessage",
        component: () => import("../components/service/postMessage.vue"),
      },
      {
        path: "/home/service/repair",
        name: "Repair",
        component: () => import("../components/service/repair.vue"),
      },
      {
        path: "/home/service/smartRepair",
        name: "SmartRepair",
        component: () => import("../components/service/nextlevel/smartRepair.vue"),
      },
      {
        path: "/home/service/houseRepair",
        name: "HouseRepair",
        component: () => import("../components/service/nextlevel/houseRepair.vue"),
      },
      {
        path: "/home/service/feedback",
        name: "Feedback",
        component: () => import("../components/service/feedback.vue"),
      },
      {
        path: "/home/user/userMessage",
        name: "UserMessage",
        component: () => import("../components/user/userMessage.vue"),
      },
      {
        path: "/home/user/adminMessage",
        name: "AdminMessage",
        component: () => import("../components/user/adminMessage.vue"),
      },
      {
        path: "/home/user/Message",
        name: "Message",
        component: () => import("../components/user/Message.vue"),
      },
      {
        path: "/home/menu/menuData",
        name: "MenuData",
        component: () => import("../components/menu/menuData.vue"),
      },
      {
        path: '/home/menu/menuData/:id',
        name: 'menuDatachild',
        component: () => import("../components/menu/menuDatachild.vue"),
      },
      {
        path: "/home/menu/loginData",
        name: "LoginData",
        component: () => import("../components/menu/loginData.vue"),
      },
      {
        path: "/home/personal/message",
        name: "Message",
        component: () => import("../components/personal/message.vue"),
      },
      {
        path: "/home/personal/change",
        name: "Change",
        component: () => import("../components/personal/change.vue"),
      },
      {
        path: "/home/personal/joinChat",
        name: "JoinChat",
        component: () => import("../components/personal/joinChat.vue"),
      },
    ],
  },
 
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
